import { get } from 'lodash-es'
import { FormProps, BasicColumn } from '@/components/Table';

export const tableColumns: BasicColumn[] = [
  {
    title: '名字',
    dataIndex: 'name',
  },
  {
    title: '类型',
    dataIndex: 'type',
    slots: { customRender: 'type' }
  },
  {
    title: '状态',
    dataIndex: 'status',
    slots: { customRender: 'status' },
  },
  {
    title: '单价(元/时)',
    dataIndex: 'price',
  }
]

export const tableFormSchema: Partial<FormProps> = {
  schemas: [
    {
      label: '状态',
      field: 'status',
      component: 'Input',
    },
    {
      label: '类型',
      field: 'type',
      component: "Select",
      
    }
  ]
}

export const roomTypeOptions = [
  {
    label: '小型',
    value: '1'
  },
  {
    label: '中型',
    value: '2'
  },
  {
    label: '大型',
    value: '3'
  },
  {
    label: '豪华',
    value: '4'
  }
]

export const roomStatusOptions = [
  {
    label: '启用',
    value: '1'
  },
  {
    label: '未启用',
    value: '0'
  }
]

export const roomFormRules: Record<string, any> = {
  name: [
    { required: true, trigger: 'change' }
  ],
  type: [
    { required: true, trigger: 'change' }
  ],
  price: [
    { required: true, trigger: 'change' }
  ]
}

/** 房间类型颜色 */
export const roomTypeColors = ['#55acee', '#cd201f', '#3b5999', '#2db7f5', '#f50']